package com.zzg.springboot.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import com.zzg.springboot.entity.UserEntity;
import com.zzg.springboot.service.UserEntityService;

@Controller
@RequestMapping("/api/springboot")
public class UserController {
	@Autowired
	private UserEntityService service;
	
	@RequestMapping(value="/ehcahe", method=RequestMethod.GET)
	@ResponseBody
	public UserEntity ehcahe(@RequestParam String name) throws InterruptedException{
		UserEntity one = service.findByName(name);
		System.out.println("第一次调用："+one.toString());
		Thread.sleep(5000);
		UserEntity two = service.findByName(name);
		System.out.println("第二次调用："+two.toString());
		return null;
	}

}
